{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import sonar\n",
    "from scipy import signanl\n",
    "fs=20e3 #采样率\n",
    "T=1/fs; #采样周期\n",
    "L=fs\n",
    "t=np.arange(L)/fs\n",
    "\n",
    "#线谱信号\n",
    "f0=1000\n",
    "theta_d=45*np.pi/180\n",
    "SNR=10\n",
    "s=np.exp(1j*(2*np.pi*f0*t))\n",
    "ti=np.arange(100)\n",
    "theta=np.zeros(ti.shape)\n",
    "theta_f=np.zeros(ti.shape)\n",
    "for i in range(ti.size):\n",
    "    X=sonar.vec_signal(s,SNR,theta_d)\n",
    "    theta[i]=sonar.sointen_t(X)*180/np.pi\n",
    "    f,cpx=signal.CSD()\n",
    "    \n",
    "plt.plot(ti,theta)\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "03830d45d556e4afb0878b18115b4ce1bfdb80e7247e5ce1ac2fef1e195100f1"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
